1. Field of the Invention
The invention relates to a method and a device of compressing digital image data, in particular, to a compressing method which is capable of improving a quality of decompressed digital image data without decreasing a compression ratio.
2. Description of the Related Art
An image compressing method, such as a method, of using vector quantization is advantageous in that a circuit of inverse transformation (expansion) can be simplified, as compared with a compressing method, such as a method used for JPEG. The method used for JPEG divides an image into a plurality of blocks each of which includes pixels and quantizes discrete cosine transform (DCT) coefficients resulting from DCT of the blocks into quantized data. The quantized data is encoded into a variable-length code.
Therefore, the image compressing method using vector quantization is generally used when a texture image is compressed by a three dimension image processing LSI. However, because the compression process is irreversible, there is a limit to increase a compression ratio with maintaining a quality of the image to a certain extent.
A previous method of compressing an image firstly divides a plurality of small area (thereafter, referred to as xe2x80x9centryxe2x80x9d) including some pixels of an original image. Then, color data including colors of each pixel in the entry are added to an area xe2x80x9ccode bookxe2x80x9d for each entry.
But, if it is determined that color data of pixels in an entry are the same as color data already stored in the code book, the same color data are not added.
Each entry is related to both the corresponding color data and location data which represent a location of the entry. As described above, since the same color data are not added, the original image is consequently compressed at a compression ratio.
However, in the method, the numbers of color data which are stored in the code book depends on a volume of a memory available for the code book.
Furthermore, in the method, since it is required that the number of pixels of an original image is increased with a quality of the compressed image kept to the same extent, a large number of entries are required. Therefore, to maintain a repeatability of the original image in this case, a memory must have a large memory capacity and thereby a compression ratio of the image can be decreased.
Also, in the method, the same compressing scheme is used both when each of consecutive entries of the original image has similar colors and when a color of a pixel in an area is completely different from a color of the adjacent pixel. Therefore, to improve a repeatability of an area of the original image where color is frequently changed, a volume of the code book required for compressing must be increased.
Therefore, it is an object of the invention to provide a method and a device of compressing digital image data. The method and the device provide an improved quality of decompressed image data without decreasing a compression ratio of the image data.
The method and the device, to achieve the above effect, rearrange the entries each of which includes some pixels on the basis of the color data and then, performs averaging process of the color data among some entries.
Further, it is an object of the invention to provide a method and a device, which omit the averaging process for an image area in which a priority mask is given. Thereby, it is possible to increase a resolution of an area of the image where a color is drastically changed, for example a color is changed for each pixel.
According to a first aspect of the invention, there is provided a method of compressing an image including a plurality of pixels. The method comprises the steps of dividing the plurality of pixels into a plurality of entries, computing representative color information of each entry using color information of pixels in the entry, rearranging the entries in order of the representative color information, grouping the rearranged entries into a plurality of group entries, averaging color information for each group entry by averaging color information of pixels in the group entry, storing the average color information for each group entry, and storing location information representing a location of the entry on the image and an address where the average color information corresponding to the entry is stored.
According to a second aspect of the invention, there is provided a device of compressing an image including a plurality of pixels. The device comprises an input image storage which input the image and stores color information which represents color of pixels of the image, an image division unit which divides the plurality of pixels into a plurality of entries, an entry sort unit which computes representative color information of each entry using the color information of pixels in the entry and rearranges the entries in order of the representative color information, an entry grouping unit which groups the rearranged entries into a plurality of group entries, an average unit which averages color information for each group entry by averaging color information of pixels in the group entry, an average color information storage which stores the average color information for each group entry, and an index which stores location information representing a location of the entry on the image and an address where the average color information corresponding to the entry is stored.
According to a third aspect of the invention, there is provided a recording medium readable by a computer, tangibly embodying a program of instructions executable by the computer to perform a method of compressing an image including a plurality of pixels. The method comprises the steps of dividing the plurality of pixels into a plurality of entries, computing representative color information of each entry using color information of pixels in the entry, the color information representing a color of the pixel, rearranging the entries in order of the representative color information, grouping the rearranged entries into a plurality of group entries, averaging color information for each group entry by averaging color information of pixels in the group entry, storing the average color information for each group entry, and storing location information representing a location of the entry on the image and an address where the average color information corresponding to the entry is stored.